<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>EOS.IO: eosio::token&lt; NumberType, CurrencyType &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceeos.html">eos</a></li><li class="navelem"><a class="el" href="structeos_1_1token.html">token</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="structeos_1_1token-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">eosio::token&lt; NumberType, CurrencyType &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__contractdev.html">How To Write Contracts</a> &raquo; <a class="el" href="group__tokens.html">Token API</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>a uint64_t wrapper with checks for proper types and over/underflows.  
 <a href="structeos_1_1token.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="token_8hpp_source.html">token.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ada7226b583058a8209db2267375ff2d9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#ada7226b583058a8209db2267375ff2d9">token</a> ()</td></tr>
<tr class="memdesc:ada7226b583058a8209db2267375ff2d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#ada7226b583058a8209db2267375ff2d9">More...</a><br /></td></tr>
<tr class="separator:ada7226b583058a8209db2267375ff2d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8d162f3708ec76236f37e74a9a9d0f49"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a8d162f3708ec76236f37e74a9a9d0f49">token</a> (NumberType v)</td></tr>
<tr class="memdesc:a8d162f3708ec76236f37e74a9a9d0f49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor for token given quantity of tokens available.  <a href="#a8d162f3708ec76236f37e74a9a9d0f49">More...</a><br /></td></tr>
<tr class="separator:a8d162f3708ec76236f37e74a9a9d0f49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40d6e8c526c6b1050f7b3e3e18db2952"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1token.html">token</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a40d6e8c526c6b1050f7b3e3e18db2952">operator-=</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a)</td></tr>
<tr class="memdesc:a40d6e8c526c6b1050f7b3e3e18db2952"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtracts quantity of token from this object.  <a href="#a40d6e8c526c6b1050f7b3e3e18db2952">More...</a><br /></td></tr>
<tr class="separator:a40d6e8c526c6b1050f7b3e3e18db2952"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a400602797c1a859ab0e43b7b1faf6225"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1token.html">token</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a400602797c1a859ab0e43b7b1faf6225">operator+=</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a)</td></tr>
<tr class="memdesc:a400602797c1a859ab0e43b7b1faf6225"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds quantity of token to this object.  <a href="#a400602797c1a859ab0e43b7b1faf6225">More...</a><br /></td></tr>
<tr class="separator:a400602797c1a859ab0e43b7b1faf6225"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3783762ae9a1dd9c5bd4d6cacf1b15ac"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a3783762ae9a1dd9c5bd4d6cacf1b15ac">operator bool</a> () const </td></tr>
<tr class="memdesc:a3783762ae9a1dd9c5bd4d6cacf1b15ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Boolean conversion operator.  <a href="#a3783762ae9a1dd9c5bd4d6cacf1b15ac">More...</a><br /></td></tr>
<tr class="separator:a3783762ae9a1dd9c5bd4d6cacf1b15ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4eefc768d2958253adf9971a138e199"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#ac4eefc768d2958253adf9971a138e199">print</a> ()</td></tr>
<tr class="memdesc:ac4eefc768d2958253adf9971a138e199"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print as string.  <a href="#ac4eefc768d2958253adf9971a138e199">More...</a><br /></td></tr>
<tr class="separator:ac4eefc768d2958253adf9971a138e199"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a3daddb64094c45d8f51897aabd44ba3d"><td class="memItemLeft" align="right" valign="top">NumberType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a3daddb64094c45d8f51897aabd44ba3d">quantity</a> = 0</td></tr>
<tr class="memdesc:a3daddb64094c45d8f51897aabd44ba3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quantity of tokens available.  <a href="#a3daddb64094c45d8f51897aabd44ba3d">More...</a><br /></td></tr>
<tr class="separator:a3daddb64094c45d8f51897aabd44ba3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a185ffd9fee7a6383ef028c3a4d7c2dee"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a185ffd9fee7a6383ef028c3a4d7c2dee">currency_type</a> = CurrencyType</td></tr>
<tr class="memdesc:a185ffd9fee7a6383ef028c3a4d7c2dee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type of the currency.  <a href="#a185ffd9fee7a6383ef028c3a4d7c2dee">More...</a><br /></td></tr>
<tr class="separator:a185ffd9fee7a6383ef028c3a4d7c2dee"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a3a4ba798d742ab3bb7c6d16a0e823ca2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1token.html">token</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a3a4ba798d742ab3bb7c6d16a0e823ca2">operator+</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:a3a4ba798d742ab3bb7c6d16a0e823ca2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds quantity of two tokens and return a new token.  <a href="#a3a4ba798d742ab3bb7c6d16a0e823ca2">More...</a><br /></td></tr>
<tr class="separator:a3a4ba798d742ab3bb7c6d16a0e823ca2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9070e8ee2d1bf7cae8438fceb0efcb51"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structeos_1_1token.html">token</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a9070e8ee2d1bf7cae8438fceb0efcb51">operator-</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:a9070e8ee2d1bf7cae8438fceb0efcb51"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtracts quantity of two tokens and return a new token.  <a href="#a9070e8ee2d1bf7cae8438fceb0efcb51">More...</a><br /></td></tr>
<tr class="separator:a9070e8ee2d1bf7cae8438fceb0efcb51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b52167a67ce0bac1f928747ce1247fb"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a6b52167a67ce0bac1f928747ce1247fb">operator&lt;=</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:a6b52167a67ce0bac1f928747ce1247fb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Less than or equal to comparison operator.  <a href="#a6b52167a67ce0bac1f928747ce1247fb">More...</a><br /></td></tr>
<tr class="separator:a6b52167a67ce0bac1f928747ce1247fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acba3f114f474466a7c6c8a77b88723df"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#acba3f114f474466a7c6c8a77b88723df">operator&lt;</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:acba3f114f474466a7c6c8a77b88723df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Less than comparison operator.  <a href="#acba3f114f474466a7c6c8a77b88723df">More...</a><br /></td></tr>
<tr class="separator:acba3f114f474466a7c6c8a77b88723df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf600f9ac9c421e3bf284577acd22547"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#abf600f9ac9c421e3bf284577acd22547">operator&gt;=</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:abf600f9ac9c421e3bf284577acd22547"><td class="mdescLeft">&#160;</td><td class="mdescRight">Greater than or equal to comparison operator.  <a href="#abf600f9ac9c421e3bf284577acd22547">More...</a><br /></td></tr>
<tr class="separator:abf600f9ac9c421e3bf284577acd22547"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b91c489658673e83721c460cb922df5"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a8b91c489658673e83721c460cb922df5">operator&gt;</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:a8b91c489658673e83721c460cb922df5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Greater than comparison operator.  <a href="#a8b91c489658673e83721c460cb922df5">More...</a><br /></td></tr>
<tr class="separator:a8b91c489658673e83721c460cb922df5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4ae7b7680fa4bd2c09be5c29571dd91"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#ac4ae7b7680fa4bd2c09be5c29571dd91">operator==</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:ac4ae7b7680fa4bd2c09be5c29571dd91"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equality comparison operator.  <a href="#ac4ae7b7680fa4bd2c09be5c29571dd91">More...</a><br /></td></tr>
<tr class="separator:ac4ae7b7680fa4bd2c09be5c29571dd91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a688813be9dc1e8f175d19ef1ffca4f6e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1token.html#a688813be9dc1e8f175d19ef1ffca4f6e">operator!=</a> (const <a class="el" href="structeos_1_1token.html">token</a> &amp;a, const <a class="el" href="structeos_1_1token.html">token</a> &amp;b)</td></tr>
<tr class="memdesc:a688813be9dc1e8f175d19ef1ffca4f6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inequality comparison operator.  <a href="#a688813be9dc1e8f175d19ef1ffca4f6e">More...</a><br /></td></tr>
<tr class="separator:a688813be9dc1e8f175d19ef1ffca4f6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt;<br />
struct eosio::token&lt; NumberType, CurrencyType &gt;</h3>

<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">NumberType</td><td>- numeric type of the token </td></tr>
    <tr><td class="paramname">CurrencyType</td><td>- type of the currency (e.g. eos) represented as an unsigned 64 bit integer</td></tr>
  </table>
  </dd>
</dl>
<p>Base token structure with checks for proper types and over/underflows. It supports the following operator: +=, -=, +, -, &lt;=, &lt;, ==, !=, &gt;=, &gt;, bool and also print functionality</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keyword">typedef</span> <a class="code" href="structeos_1_1token.html">eosio::token&lt;uint32_t, N(MyToken)&gt;</a> MyToken;</div><div class="line">MyToken  a(128);</div><div class="line">a.print(); <span class="comment">// Output: 128 MyToken</span></div><div class="line">MyToken b(64);</div><div class="line">a += b;</div><div class="line">a.print(); <span class="comment">// Output: 192 MyToken</span></div><div class="line">b.print(); <span class="comment">// Output:  64 MyToken</span></div><div class="line">a -= b;</div><div class="line">a.print(); <span class="comment">// Output: 128 MyToken</span></div><div class="line">b.print(); <span class="comment">// Output:  64 MyToken</span></div><div class="line">b -= a;    <span class="comment">// Throws integer underflow exception</span></div><div class="line">MyToken c = a + b;</div><div class="line">c.print(); <span class="comment">// Output: 192 MyToken</span></div><div class="line">MyToken d = a - b;</div><div class="line">d.print(); <span class="comment">// Output: 64 MyToken</span></div><div class="line">MyToken maxToken(<a class="code" href="group__mathcppapi.html#ga422f063ec99a30ab7a395f0fafeffcb2">std::numeric_limits&lt;uint32_t&gt;::max</a>());</div><div class="line">maxToken += b; <span class="comment">// Throws integer overflow exception</span></div><div class="line">std::cout &lt;&lt; (maxToken &gt; b); <span class="comment">// Output: true</span></div><div class="line">std::cout &lt;&lt; (b &gt; maxToken); <span class="comment">// Output: false</span></div><div class="line">std::cout &lt;&lt; (bool)maxToken; <span class="comment">// Output: true</span></div><div class="line">std::cout &lt;&lt; (a == b);  <span class="comment">// Output: false</span></div><div class="line">std::cout &lt;&lt; (a != b);  <span class="comment">// Output: true</span></div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ada7226b583058a8209db2267375ff2d9"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::<a class="el" href="structeos_1_1token.html">token</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Default constructor </p>

</div>
</div>
<a class="anchor" id="a8d162f3708ec76236f37e74a9a9d0f49"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::<a class="el" href="structeos_1_1token.html">token</a> </td>
          <td>(</td>
          <td class="paramtype">NumberType&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Constructor for token given quantity of tokens available </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">v</td><td>- quantity of tokens available </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3783762ae9a1dd9c5bd4d6cacf1b15ac"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::operator bool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Boolean conversion operator </p><dl class="section return"><dt>Returns</dt><dd>true if quantity is not zero </dd></dl>

</div>
</div>
<a class="anchor" id="a400602797c1a859ab0e43b7b1faf6225"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">token</a>&amp; <a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::operator+= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Adds quantity of token to this object Throws an exception if overflow </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be added </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>this token after addition </dd></dl>

</div>
</div>
<a class="anchor" id="a40d6e8c526c6b1050f7b3e3e18db2952"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">token</a>&amp; <a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::operator-= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Subtracts quantity of token from this object Throws an exception if underflow </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be subtracted </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>this token after subtraction </dd></dl>

</div>
</div>
<a class="anchor" id="ac4eefc768d2958253adf9971a138e199"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::print </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Print as string representation of the token (e.g. 1 EOS) </p>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="a688813be9dc1e8f175d19ef1ffca4f6e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Inequality comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is not equal to quantity of b </dd></dl>

</div>
</div>
<a class="anchor" id="a3a4ba798d742ab3bb7c6d16a0e823ca2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">token</a> operator+ </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Adds quantity of two tokens and return a new token Throws an exception if overflow </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be added </td></tr>
    <tr><td class="paramname">b</td><td>token to be added </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of addition as a new token </dd></dl>

</div>
</div>
<a class="anchor" id="a9070e8ee2d1bf7cae8438fceb0efcb51"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structeos_1_1token.html">token</a> operator- </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Subtracts quantity of two tokens and return a new token Throws an exception if underflow </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be subtracted </td></tr>
    <tr><td class="paramname">b</td><td>token to be subtracted </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>result of subtraction as a new token </dd></dl>

</div>
</div>
<a class="anchor" id="acba3f114f474466a7c6c8a77b88723df"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&lt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Less than comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is less than quantity of b </dd></dl>

</div>
</div>
<a class="anchor" id="a6b52167a67ce0bac1f928747ce1247fb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&lt;= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Less than or equal to comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is less than or equal to quantity of b </dd></dl>

</div>
</div>
<a class="anchor" id="ac4ae7b7680fa4bd2c09be5c29571dd91"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Equality comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is equal to quantity of b </dd></dl>

</div>
</div>
<a class="anchor" id="a8b91c489658673e83721c460cb922df5"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&gt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Greater than comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is greater than quantity of b </dd></dl>

</div>
</div>
<a class="anchor" id="abf600f9ac9c421e3bf284577acd22547"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&gt;= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structeos_1_1token.html">token</a>&lt; NumberType, CurrencyType &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Greater than or equal to comparison operator </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">a</td><td>token to be compared </td></tr>
    <tr><td class="paramname">b</td><td>token to be compared </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if quantity of a is greater than or equal to quantity of b </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a185ffd9fee7a6383ef028c3a4d7c2dee"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> <a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::currency_type = CurrencyType</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Type of the currency (e.g. eos) represented as an unsigned 64 bit integer </p>

</div>
</div>
<a class="anchor" id="a3daddb64094c45d8f51897aabd44ba3d"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename NumberType, uint64_t CurrencyType = N(eos)&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">NumberType <a class="el" href="structeos_1_1token.html">eosio::token</a>&lt; NumberType, CurrencyType &gt;::quantity = 0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Quantity of tokens available </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>contracts/eoslib/<a class="el" href="token_8hpp_source.html">token.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
